<?
	require_once "include/User.php";
	require_once "include/Article.php";
	require_once "include/Template.php";
	require_once "include/backend/ArticlesDb.php";
	session_start();

	if (is_numeric($_GET['id'])) {
		$articles = new ArticlesDb();
		$result = $articles->get(1, $_GET['id']);
		$result = $articles->result2array($result);
		
		$page = new Template();
		$page->setUser($_SESSION['user']);
		$article = new Article($result[0]);
		$page->addContent($article->getHTML());
		echo $page->getHTML();
	}
	else
		header("Location: ./");
?>
